package com.secondary.action.mainAction;





import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.secondary.action.BaseAction;
import com.secondary.pojos.Category;
import com.secondary.service.CategoryService;



@ParentPackage(value = "struts-default")
@Namespace(value = "/main")
@Action(value="showIndex")
@Results({ 
	@Result(name = "success", location = "/index.jsp")
		})
public class MainAction extends BaseAction{
	
	@Resource
	private CategoryService categoryService;
	private List<Category> cateList;
	
	public String show(){
		
		cateList=categoryService.findParentCategory(0);
		return "success";
	}
	public CategoryService getCategoryService() {
		return categoryService;
	}
	public void setCategoryService(CategoryService categoryService) {
		this.categoryService = categoryService;
	}
	public List<Category> getCateList() {
		return cateList;
	}
	public void setCateList(List<Category> cateList) {
		this.cateList = cateList;
	}
	
}
